package cn.hls.entity;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * @fileName: SmsInfo.java
 * @package: cn.hls.entity 　*@Description:短信发送实体信息 　*@author: yinghui.zhang
 *           　*@email: uuhui@163.com
 * @date: 2016年12月25日
 * 
 */
@Entity
@Table(name = "T_SMS_INFO")
@DynamicInsert
@DynamicUpdate
public class SmsInfo extends BaseEntity {
	private static final long serialVersionUID = 1L;
	private Member member;// 发送对象
	private String content;// 发送内容
	private Integer status;// 发送状态
	private String operator;// 操作人员
	private Date beginTime;// 开始时间
	private Date endtime;// 结束时间
	private Timestamp sendTime;//发送时间
	private List<Long>memberIds;

	@ManyToOne(cascade = CascadeType.REFRESH)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "member_id")
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@Column(name = "content", length = 100)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "status", columnDefinition = "char default 1")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "operator", length = 16)
	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	@JsonIgnore
	@Transient
	public Date getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}

	@JsonIgnore
	@Transient
	public Date getEndtime() {
		return endtime;
	}
	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}

	@Column(name="send_time")
	public Timestamp getSendTime() {
		return sendTime;
	}

	public void setSendTime(Timestamp sendTime) {
		this.sendTime = sendTime;
	}

	@JsonIgnore
	@Transient
	public List<Long> getMemberIds() {
		return memberIds;
	}

	public void setMemberIds(List<Long> memberIds) {
		this.memberIds = memberIds;
	}
}
